import React, { useState, useEffect } from 'react';
import { connect } from 'dva';
import styles from './index.less';
import { Row, Col, Tabs } from 'antd';
import Statistics from './statistics';
import BuildType from './build';
import Service from './service';
import Domain from './domain';
import Budget from './budget';
import Department from './department';
const { TabPane } = Tabs;
const Number = ({ data, dispatch }) => {
  const [type, settype] = useState(1);
  const tabChange = tab => {
    console.log(tab);
    settype(tab);
  };
  return (
    <Row>
      <Statistics />
      <Row className={styles.tabs}>
        <Tabs
          defaultActiveKey="1"
          onChange={tabChange}
          style={{ width: '100%' }}
        >
          <TabPane tab="按项目性质分析" key="1">
            <BuildType type={type} />
          </TabPane>
          <TabPane tab="按项目类型分析" key="2">
            <Service type={type} />
          </TabPane>
          <TabPane tab="按行业领域分析" key="3">
            <Domain type={type} />
          </TabPane>
          <TabPane tab="按评审机构分析" key="4">
            <Department type={type} />
          </TabPane>
          <TabPane tab="按评审专家分析" key="5">
            <Budget type={type} />
          </TabPane>
        </Tabs>
      </Row>
    </Row>
  );
};
export default connect(state => state['namespace'])(Number);
